package com.homework.test1;

public class Demo1 {
    public static void main(String[] args) {
        int[] arr = new int[5];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = (int)(Math.random()*(100+1-1)) + 1;
        }
        System.out.print("该数组为：");
        for (int i : arr) {
            System.out.print(i+" ");
        }
        System.out.println();
        int max = 0,min = arr[0];
        for (int i : arr) {
            if (max<i){
                max = i;
            }
            if (min>i){
                min = i;
            }
        }
        System.out.println("max = " + max);
        System.out.println("min = " + min);
    }
}
